package com.lanqiao.javaparkinglot.dao;

import com.lanqiao.javaparkinglot.entity.Hwhs;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Mapper
public interface HwhsDao {
    //查询
    @Select("select *from tb_hshw")
    List<Hwhs> findhwhs();
    //添加
    @Update("insert into tb_hshw (hsh_id,hsh_type,hsh_source,hsh_location,hsh_result,hsh_car,hsh_driver,hsh_dnumber,hsh_owner,hsh_onunber)VALUES (#{hsh_id},#{hsh_type},#{hsh_source},#{hsh_location},#{hsh_result},#{hsh_car},#{hsh_driver},#{hsh_dnumber},#{hsh_owner},#{hsh_onunber})")
    @Transactional
    void addhwhs(Hwhs hwhs);
    //修改
    @Update("update tb_hshw set hsh_id=#{hsh_id},hsh_type=#{hsh_type},hsh_source=#{hsh_source},hsh_location=#{hsh_location},hsh_result=#{hsh_result},hsh_car=#{hsh_car},hsh_driver=#{hsh_driver},hsh_dnumber=#{hsh_dnumber},hsh_owner=#{hsh_owner},hsh_onunber=#{hsh_onunber}where hsh_id=#{hsh_id} ")
    @Transactional
    void updatehwhs(Hwhs hwhs);
    //删除
    @Delete("delete from tb_hshw where hsh_id=#{hsh_id}")
    void deletehwhs (Long hsh_id);
}
